﻿<ResourceDictionary
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
	<!-- Resource dictionary entries should be defined here. -->
	<Style x:Key="TabItemFocusVisual">
		<Setter Property="Control.Template">
			<Setter.Value>
				<ControlTemplate>
					<Rectangle SnapsToDevicePixels="true" Stroke="Black" StrokeDashArray="1 2" StrokeThickness="1" Margin="3,3,3,1"/>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>
	
	<SolidColorBrush x:Key="TabControlNormalBorderBrush" Color="#8C8E94"/>
	<LinearGradientBrush x:Key="ButtonNormalBackground" EndPoint="0,1" StartPoint="0,0">
		<GradientStop Color="#F3F3F3" Offset="0"/>
		<GradientStop Color="#EBEBEB" Offset="0.5"/>
		<GradientStop Color="#DDDDDD" Offset="0.5"/>
		<GradientStop Color="#CDCDCD" Offset="1"/>
	</LinearGradientBrush>
	<LinearGradientBrush x:Key="TabItemHotBackground" EndPoint="0,1" StartPoint="0,0">
		<GradientStop Color="#e68e8c" Offset="0"/>
		<GradientStop Color="#c32a2a" Offset="0.7"/>
		<GradientStop Color="#323230" Offset="1"/>
	</LinearGradientBrush>
	
	<SolidColorBrush x:Key="TabItemSelectedBackground" Color="#F9F9F9"/>
	<SolidColorBrush x:Key="TabItemHotBorderBrush" Color="#3C7FB1"/>
	<SolidColorBrush x:Key="TabItemDisabledBorderBrush" Color="#FFC9C7BA"/>
		
	<SolidColorBrush x:Key="TabControlOuterBorder" Color="#121011"/>
	<SolidColorBrush x:Key="TabControlInnerBorder" Color="#5c5e5b"/>
	
	<LinearGradientBrush x:Key="TabItemBackground" EndPoint="0,1" StartPoint="0,0">
		<GradientStop Color="#FF949494" Offset="1"/>
		<GradientStop Color="#323230" Offset="0"/>
	</LinearGradientBrush>
	
	
	<LinearGradientBrush x:Key="TabItemHoverBackground" EndPoint="0,1" StartPoint="0,0">
		<GradientStop Color="#FF949494" Offset="0"/>
		<GradientStop Color="#323230" Offset="0.8"/>
	</LinearGradientBrush>
	
	<LinearGradientBrush x:Key="TabItemSideBackground" EndPoint="0,1" StartPoint="0,0">
		<GradientStop Color="#e68e8c" Offset="0"/>
		<GradientStop Color="#c32a2a" Offset="0.7"/>
		<GradientStop Color="#323230" Offset="1"/>
	</LinearGradientBrush>
	
	<LinearGradientBrush x:Key="TabItemSideBackgroundBottom" EndPoint="0,0" StartPoint="0,1">
		<GradientStop Color="#e68e8c" Offset="0"/>
		<GradientStop Color="#c32a2a" Offset="0.7"/>
		<GradientStop Color="#323230" Offset="1"/>
	</LinearGradientBrush>
	
	<LinearGradientBrush x:Key="TabItemSideBorderBrush" EndPoint="0,1" StartPoint="0,0">
		<GradientStop Color="#e8a7a5" Offset="0"/>
		<GradientStop Color="#e8a7a5" Offset="0.7"/>
		<GradientStop Color="#323230" Offset="1"/>
	</LinearGradientBrush>
	
	<LinearGradientBrush x:Key="TabItemGlassBrush" EndPoint="0,1" StartPoint="0,0">
		<GradientStop Color="#96FFFFFF" Offset="0"/>
		<GradientStop Color="#28FFFFFF" Offset="0.5"/>
		<GradientStop Color="#00FFFFFF" Offset="0.5"/>
	</LinearGradientBrush>
	
	
	<!--Disabled-->
	<LinearGradientBrush x:Key="TabItemDisabledBackground" EndPoint="0,1" StartPoint="0,0">
		<GradientStop Color="#b4b4b4" Offset="1"/>
		<GradientStop Color="#dfdfdf" Offset="0"/>
	</LinearGradientBrush>
	
	<SolidColorBrush x:Key="TabControlOuterBorderDisabled" Color="#b8b8b8"/>
	<SolidColorBrush x:Key="TabControlInnerBorderDisabled" Color="#cfcfcf"/>
	
	<LinearGradientBrush x:Key="TabItemSideDisabledBackground" EndPoint="0,1" StartPoint="0,0">
		<GradientStop Color="#f4f4f4" Offset="0"/>
		<GradientStop Color="#d7d7d7" Offset="0.7"/>
		<GradientStop Color="#c2c2c2" Offset="1"/>
	</LinearGradientBrush>
	
	<LinearGradientBrush x:Key="TabItemSideDisabledBorderBrush" EndPoint="0,1" StartPoint="0,0">
		<GradientStop Color="#f6f6f6" Offset="0"/>
		<GradientStop Color="#f6f6f6" Offset="0.7"/>
		<GradientStop Color="#c2c2c2" Offset="1"/>
	</LinearGradientBrush>
	
	
	
	
	<Style TargetType="{x:Type TabItem}">
		<Setter Property="FocusVisualStyle" Value="{StaticResource TabItemFocusVisual}"/>
		<Setter Property="Foreground" Value="White"/>
		<Setter Property="Padding" Value="6,0,6,0"/>
		<Setter Property="BorderBrush" Value="{StaticResource TabControlNormalBorderBrush}"/>
		<Setter Property="Background" Value="{StaticResource ButtonNormalBackground}"/>
		<Setter Property="HorizontalContentAlignment" Value="Stretch"/>
		<Setter Property="VerticalContentAlignment" Value="Stretch"/>
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="{x:Type TabItem}">
					<Grid SnapsToDevicePixels="true" RenderTransformOrigin="1,1" x:Name="grid">
						<Grid.RenderTransform>
							<TransformGroup>
								<ScaleTransform ScaleX="1" ScaleY="1"/>
								<SkewTransform AngleX="0" AngleY="0"/>
								<RotateTransform Angle="0"/>
								<TranslateTransform X="0" Y="0"/>
							</TransformGroup>
						</Grid.RenderTransform>
						<Border x:Name="OuterBd" BorderBrush="{StaticResource TabControlOuterBorder}" BorderThickness="1,1,1,0" CornerRadius="4,4,0,0">							
							<Grid>
								<Grid.ColumnDefinitions>
									<ColumnDefinition/>
									<ColumnDefinition Width="Auto"/>
								</Grid.ColumnDefinitions>
								<Border Grid.Row="0" Grid.Column="0" x:Name="Bd" Background="{StaticResource TabItemBackground}" BorderBrush="{StaticResource TabControlInnerBorder}" CornerRadius="3,0,0,0" BorderThickness="1,1,0,0" Padding="3,0,1,2">
									<ContentPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" HorizontalAlignment="{Binding Path=HorizontalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}" x:Name="Content" VerticalAlignment="{Binding Path=VerticalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}" ContentSource="Header" RecognizesAccessKey="True"/>
								</Border>
								<Border x:Name="BdSide" Grid.Row="0" Grid.Column="1" Width="10" Background="{StaticResource TabItemSideBackground}" BorderBrush="{StaticResource TabItemSideBorderBrush}" CornerRadius="0,3,0,0" BorderThickness="1,0,0,0"/>
							</Grid>
						</Border>
						<Border x:Name="BdGlass" Margin="2" CornerRadius="3,3,0,0" Background="{StaticResource TabItemGlassBrush}"/>
					</Grid>
					<ControlTemplate.Triggers>
						<Trigger Property="IsMouseOver" Value="true">
							<Setter Property="Background" TargetName="Bd" Value="{StaticResource TabItemHoverBackground}"/>
						</Trigger>
						<Trigger Property="IsSelected" Value="true">
							<Setter Property="Panel.ZIndex" Value="1"/>
							<Setter Property="Margin" TargetName="OuterBd" Value="0,1,0,-1"/>
							<Setter Property="Background" TargetName="Bd" Value="{StaticResource TabItemHoverBackground}"/>
						</Trigger>
						<Trigger Property="IsEnabled" Value="false">
							<Setter Property="Background" TargetName="BdSide" Value="{StaticResource TabItemSideDisabledBackground}"/>
							<Setter Property="BorderBrush" TargetName="BdSide" Value="{StaticResource TabItemSideDisabledBorderBrush}"/>
							<Setter Property="Background" TargetName="Bd" Value="{StaticResource TabItemDisabledBackground}"/>
							<Setter Property="BorderBrush" TargetName="Bd" Value="{StaticResource TabControlInnerBorderDisabled}"/>
							<Setter Property="BorderBrush" TargetName="OuterBd" Value="{StaticResource TabControlOuterBorderDisabled}"/>
							<Setter Property="Foreground" Value="{StaticResource TabControlOuterBorderDisabled}"/>
						</Trigger>
						<Trigger Property="TabStripPlacement" Value="Left">
							<Setter Property="LayoutTransform">
								<Setter.Value>
									<RotateTransform Angle="-90"/>
								</Setter.Value>
							</Setter>
							<Setter Property="Margin" Value="2,0,-2,0"/>
						</Trigger>
						<Trigger Property="TabStripPlacement" Value="Right">
							<Setter Property="LayoutTransform">
								<Setter.Value>
									<RotateTransform Angle="90"/>
								</Setter.Value>
							</Setter>
						</Trigger>
						<Trigger Property="TabStripPlacement" Value="Bottom">
							<Setter Property="BorderThickness" TargetName="OuterBd" Value="1,0,1,1"/>
							<Setter Property="CornerRadius" TargetName="OuterBd" Value="0,0,4,4"/>
							<Setter Property="CornerRadius" TargetName="BdSide" Value="0,0,3,0"/>
							<Setter Property="CornerRadius" TargetName="Bd" Value="0,0,0,3"/>
							<Setter Property="BorderThickness" TargetName="Bd" Value="1,0,0,1"/>
							<Setter Property="CornerRadius" TargetName="BdGlass" Value="0"/>
							<Setter Property="Margin" TargetName="BdGlass" Value="2,0,2,0"/>
							<Setter Property="Background" TargetName="BdSide" Value="{StaticResource TabItemSideBackgroundBottom}"/>
						</Trigger>
						<MultiTrigger>
							<MultiTrigger.Conditions>
								<Condition Property="IsSelected" Value="true"/>
								<Condition Property="TabStripPlacement" Value="Top"/>
							</MultiTrigger.Conditions>
							<Setter Property="Margin" Value="-2,-2,-2,-1"/>
							<Setter Property="Margin" TargetName="Content" Value="0,0,0,1"/>
						</MultiTrigger>
						<MultiTrigger>
							<MultiTrigger.Conditions>
								<Condition Property="IsSelected" Value="true"/>
								<Condition Property="TabStripPlacement" Value="Bottom"/>
							</MultiTrigger.Conditions>
							<Setter Property="Margin" Value="-2,-1,-2,-2"/>
							<Setter Property="Margin" TargetName="Content" Value="0,1,0,0"/>
						</MultiTrigger>
						<MultiTrigger>
							<MultiTrigger.Conditions>
								<Condition Property="IsSelected" Value="true"/>
								<Condition Property="TabStripPlacement" Value="Left"/>
							</MultiTrigger.Conditions>
							
							<Setter Property="Margin" Value="-2,-2,-1,-2"/>
							<Setter Property="Margin" TargetName="Content" Value="0,0,1,0"/>
						</MultiTrigger>
						<MultiTrigger>
							<MultiTrigger.Conditions>
								<Condition Property="IsSelected" Value="true"/>
								<Condition Property="TabStripPlacement" Value="Right"/>
							</MultiTrigger.Conditions>
							<Setter Property="Margin" Value="-1,-2,-2,-2"/>
							<Setter Property="Margin" TargetName="Content" Value="1,0,0,0"/>
						</MultiTrigger>
					</ControlTemplate.Triggers>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>	
</ResourceDictionary>